<?php
class Zendvn_Models_Visiters extends Zend_Db_Table{
	protected $_name = 'visiters';
	protected $_primary = 'id';
	
	public function getVisters($options = null){		
		$db = $this->getAdapter();
		if($options['task'] == 'public-visiters'){
			$select = $db->select()
                                    ->from($this->_name)
                                    ->where('id = 1');
			$result  = $db->fetchAll($select);
		}
		return $result;
	}
	
	public function updateVisters($number, $options = null){
                if($options['task'] == 'public-visiters'){
                    $data = array('numbers'=>$number+1);
                    $where = 'id = 1';
                    $this->update($data,$where);
                }		
	}
}